package com.szakul.pdf.viewer.dao.beans;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.annotations.ForeignKey;
import org.hibernate.annotations.Type;


@Entity
@Table(name="leaf")
public class Leaf implements Serializable{

    /**
	 * 
	 */
	private static final long serialVersionUID = 5894676208817012045L;

	@Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    @Column(name="leafId")
    private int id;

    @Column(name="name")
    private String name;
    
    @Column(name="pdf_file_path")
	private String pdfFilePath;
	
    @Column(name="image_file_path")
	private String imageFilePath;
	
    @Column(name="description_label")
    @Type(type="text")
	private String descriptionLabel;
	
    @Column(name="table_of_content_label")
	private String tableOfContentLabel;
    

    @ManyToOne
    @JoinColumn(name="nodeId")     // inverse = false
    @ForeignKey(name = "nodeId")
    private Node node;

    public Leaf() {
    }
    
    /**
     * Constructor.
     * 
     * @param name
     */
    public Leaf(final String name) {
    	this.name = name;
    }

    /**
     * @return the id
     */
    public int getId() {
        return id;
    }


    /**
     * @param id the id to set
     */
    public void setId(final int id) {
        this.id = id;
    }


    /**
     * @return the name
     */
    public String getName() {
        return name;
    }


    /**
     * @param name the name to set
     */
    public void setName(final String name) {
        this.name = name;
    }



    /**
     * @return the node
     */
    public Node getNode() {
        return node;
    }



    /**
     * @param node the node to set
     */
    public void setNode(final Node node) {
        this.node = node;
    }


	/**
	 * @return the pdfFilePath
	 */
	public String getPdfFilePath() {
		return pdfFilePath;
	}


	/**
	 * @param pdfFilePath the pdfFilePath to set
	 */
	public void setPdfFilePath(String pdfFilePath) {
		this.pdfFilePath = pdfFilePath;
	}


	/**
	 * @return the imageFilePath
	 */
	public String getImageFilePath() {
		return imageFilePath;
	}


	/**
	 * @param imageFilePath the imageFilePath to set
	 */
	public void setImageFilePath(String imageFilePath) {
		this.imageFilePath = imageFilePath;
	}


	/**
	 * @return the descriptionLabel
	 */
	public String getDescriptionLabel() {
		return descriptionLabel;
	}


	/**
	 * @param descriptionLabel the descriptionLabel to set
	 */
	public void setDescriptionLabel(String descriptionLabel) {
		this.descriptionLabel = descriptionLabel;
	}


	/**
	 * @return the tableOfContentLabel
	 */
	public String getTableOfContentLabel() {
		return tableOfContentLabel;
	}


	/**
	 * @param tableOfContentLabel the tableOfContentLabel to set
	 */
	public void setTableOfContentLabel(String tableOfContentLabel) {
		this.tableOfContentLabel = tableOfContentLabel;
	}




}
